<?php
/* 
 * EachGo电商网站 新媒体
 * www.eachgo.cn
 */
namespace Home\Controller;
use Think\Controller;
class LotteryController extends Controller{
    public function addLottery(){
        $lottery=D('Lottery');
        $data=array(
            'isGot'=>false,
            'time'=>date('Y-m-d h:i:s'),
            'level'=>2,
            'user_ID'=>2,
            'orderInfo_ID'=>2,
        );
        $result=$lottery->addLottery($data);
        var_dump($result);        
    }
    public function delLottery(){
        $lottery=D('Lottery');
        $result=$lottery->deleteLottery(3);
        var_dump($result);
    }
    public function getAllLottery(){
        $lottery=D('Lottery');
        $result=$lottery->queryAll();
        var_dump($result);
    }
    public function updateLottery(){
        $lottery=D('Lottery');
        $data=array(
            'id'=>3,
            'isGot'=>true,
        );
        $result=$lottery->update($data);
        var_dump($result);
    }
    public function getLottery(){
        $lottery=D('Lottery');
        $result=$lottery->queryByUserId(2);
        var_dump($result);
        $result=$lottery->isGot(2);
        var_dump($result);
        $result=$lottery->isUsed(2);
        var_dump($result);
    }
}